package com.vdimitr.happycube.puzzle.piece.match;

import com.vdimitr.happycube.puzzle.matrix.MatrixMatcher;
import com.vdimitr.happycube.puzzle.piece.PuzzlePiece;

/**
 * This class is responsible for determining if two puzzle pieces fit together
 * by attaching one puzzle piece's right side with the other puzzle piece's left
 * side
 * 
 * @author vasileios.dimitriadis
 * 
 */
public class PuzzlePieceLeftToRightMatcher {

	/**
	 * Determines if the two puzzle pieces can fit together by using their
	 * matrix representation to match them. That is if the right side of the
	 * left puzzle piece can match the left side of the right puzzle piece.
	 * 
	 * @param leftPuzzlePiece
	 *            the puzzle piece on the left
	 * @param rightPuzzlePiece
	 *            the puzzle piece on the right
	 * @return True if the two puzzle pieces fit
	 */
	public boolean puzzlePiecesMatchLeftToRight(PuzzlePiece leftPuzzlePiece,
			PuzzlePiece rightPuzzlePiece) {
		return MatrixMatcher.matricesMatchLeftToRight(
				leftPuzzlePiece.getMatrix(), rightPuzzlePiece.getMatrix());
	}
}
